﻿using System.Web;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
using Mondial2014.Models.Context;

namespace Mondial2014
{
    public class MvcApplication : HttpApplication
    {
        protected void Application_Start()
        {
      ModelBinders.Binders.DefaultBinder = new PerpetuumSoft.Knockout.KnockoutModelBinder();
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            using (var initializer = new Mondial2014ContextInitializer())
            {
                initializer.InitializeContext();
            }
        }
    }
}
